Repository navigation
feat: let a site switch off the pieces it does not want, starting with post locks - #724
Conversation
🚩 New public surface
|
🛝 WordPress PlaygroundsBuilt from b4b3e90
|
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the Core Committers: Use this line as a base for the props when committing in SVN: To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Feature settings leak between tests, and disabling post locks leaves an unnecessary widget query active.
Review effort: Balanced
Findings: 2
Open (2)
What changed in this PR
Adds per-site and multisite feature switches, initially allowing the post-lock bridge to be disabled while retaining core post-meta locking.
Changes:
- Adds feature configuration, filtering, settings UI, and cleanup.
- Conditionally registers post-lock hooks.
- Adds documentation and tests for feature-switch behavior.
| File | Description |
|---|---|
README.md |
Documents the feature filter and post-lock switch. |
plugins/presence-api/uninstall.php |
Removes feature options during uninstall. |
plugins/presence-api/tests/test-features.php |
Tests settings and post-lock switching. |
plugins/presence-api/presence-api.php |
Loads feature definitions before hooks. |
plugins/presence-api/includes/settings.php |
Adds site and network feature controls. |
plugins/presence-api/includes/features.php |
Implements feature definitions and state resolution. |
plugins/presence-api/includes/default-filters.php |
Gates post-lock hook registration. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
…ng test teardown' Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
ced3c81 to
b4b3e90
Compare
…share its screens
* feat: let a site switch off the Active Posts dashboard widget Add a dashboard-widget feature and gate the Active Posts widget's hooks behind wp_presence_feature_enabled(), the way #724 did for post locks, so a site can switch it off on Settings > Presence API. Part of #710. * fix: put the Active Posts default placement behind the dashboard-widget switch too * fix: restore the 0.16.1 version the merge rolled back --------- Co-authored-by: Joe Fusco <josephfusco@users.noreply.github.com> Co-authored-by: Joe Fusco <hello@josephfus.co>

Gutenberg gates its experiments where files load, but #558 put every hook in
default-filters.phpandavatar-stack.phpis shared beyond the admin bar, so this gates hook blocks instead; switching post locks off while someone holds a lock should leave the post looking unlocked until their next lock refresh writes post meta, which I inferred from the code rather than tested.Only post locks can be switched off for now. Each remaining piece in #710 adds its entry to
wp_presence_get_features(), wraps its block indefault-filters.php, and adds a test, so a checkbox never appears for something it cannot turn off. With post locks off, the Active Posts widget still runs one lock-priming query per render that nothing reads.Related: #710
Use of AI Tools
AI assistance: Yes
Tool(s): Claude Code
Model(s): Claude Opus 5.5
Used for: Reading Gutenberg's experiments code for the pattern, writing the switch, tests and README entry, and running PHPCS and PHPStan locally. Opened as a draft until I've reviewed the diff.